import request from "../utils/request";
import { PaginationParams,RoleDeleteParams,PermissionPrams,RoleEditParams,RoleCreateParams } from "@/interface/role"

// 角色列表
export function roleAllList():any  {
  return request({
    type:'get',
    url:"/role/allList",
    data:{},
  })
}
// 角色列表
export function roleList(data:PaginationParams):any  {
    return request({
      type:'get',
      url:"/role/list",
      data,
    })
}

// 角色创建
export function roleCreate(data:RoleCreateParams):any  {
  return request({
    type:'post',
    url:"/role/create",
    data,
  })
}

// 角色编辑
export function roleEdit(data:RoleEditParams):any  {
  return request({
    type:'post',
    url:"/role/edit",
    data,
  })
}

// 角色删除
export function roleDelete(data:RoleDeleteParams):any  {
  return request({
    type:'post',
    url:"/menu/delete",
    data,
  })
}

// 更新权限
export function updatePermission(data:PermissionPrams):any {
  return request({
    type:'post',
    url:"/role/update/permission",
    data,
  })
}